<template>
  <div>
    <div style="text-align: right;">
      <el-button type="primary" @click="doReturn">返回</el-button>
      <el-button type="primary" @click="doSubmit">确 定</el-button>
    </div>
    <br />

    <el-form :model="user" :rules="mergeFormRules" ref="user" label-width="100px">
      <el-form-item label="用户名" prop="username">
        <el-input v-model="user.username" autocomplete="off" class="disabled"></el-input>
      </el-form-item>
      <el-form-item label="邮箱" prop="email">
        <el-input v-model="user.email" autocomplete="off" class="disabled"></el-input>
      </el-form-item>
      <el-form-item label="手机号" prop="mobile">
        <el-input v-model="user.mobile" autocomplete="off" class="disabled"></el-input>
      </el-form-item>
      <!-- <el-form-item label="状态" prop="status"> -->
      <input type="radio" value="0" v-model="user.status">正常</input>
        <input type="radio" value="1" v-model="user.status">禁用</input>
      <!-- <el-radio v-model="user.status" label="0">正常</el-radio>
        <el-radio v-model="user.status" label="1">禁用</el-radio> -->
      <!-- </el-form-item> -->
    </el-form>

  </div>
</template>

<script>
  export default {
    methods: {
      doSubmit: function() {
        // alert(this.user.userId)
        // this.user.usreId = user.userId
        this.axios.post(this.axios.urls.SYS_USER_MERGE, {
          userId: this.user.userId,
          username: this.user.username,
          email: this.user.email,
          mobile: this.user.mobile
        }).then((response) => {
          this.$message({
            type: 'success',
            message: response.data.message
          })
        })
        this.$router.push('/AppMain/userList')
      },
      doReturn: function() {
        this.$router.push('/AppMain/userList')
        // alert(111)
      }
    },
    computed: {
      user: function() {
        return this.$store.getters.user
      }
    },
    // created: function() {
    //   user: this.$store.getters.user
    // }
  }
</script>

<style>
</style>
